import QtQuick 1.1
import com.meego 1.0
import "Modulelib.js" as ModuleUtil

// 车型列表页面
Page {
    id: module_detail_page

    tools: ModuleToolBar{}

    orientationLock : PageOrientation.LockPortrait

    property bool busy: false

    TitleBar{
        id: module_detail_title
        anchors.top: module_detail_page.top; anchors.left: module_detail_page.left
        width: module_detail_page.width; height: 71
        titleName: ModuleUtil.current_module_name
    }

    Rectangle{
        id: detail_list_rect
        width: parent.width; height: parent.height - module_detail_title.height
        anchors.left: parent.left; anchors.top: module_detail_title.bottom
        opacity: 0
    }


    ModuleVehiclesListModel{
        id: detail_data
    }

    Component{
         id: detailDelegate
        VehicleListItem{
            backType: backType
            itemType: Type
            title: titleName
            itemName: vehName
            itemNum: vehNum
            image: img
            vehicleId: id
        }
     }

    ListView{
        id: detail_list
        anchors.fill: detail_list_rect
        model: detail_data
        delegate: detailDelegate
    }

    BusyLoading{
        id: loading
        anchors.centerIn: parent
        visible:false
    }

    Component.onCompleted: {
        loading.loading()
        detail_data.getData();
    }
}
